
package com.googlecode.icaltohtml.cssparser;

import java_cup.runtime.*;
import java.io.IOException;


%%
%public
%class Lexer

%unicode

%ignorecase
%cupsym ParserSym
%cup
%line
%column


%{
	public final boolean debugMode=false;
	
	private Symbol symb(int type)
	{
		return symb(type, yytext());
	}

	private Symbol symb(int type, Object value)
	{
		return new Symbol(type, yyline, yycolumn, value);
	}

%}



nl					=	\n|\r|\r\n

go					=	"{"
gc					=	"}"
dp					=	":"
pv					=	";"

class_name			=	"."(event|todo|journal)
time				=	(past|future)

prop				=	background-color | color
rgb_col				=	"#"[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]



%%


{go}			{ if(debugMode) System.out.println("Trovato simbolo go"); return symb(ParserSym.go); }
{gc}			{ if(debugMode) System.out.println("Trovato simbolo gc"); return symb(ParserSym.gc); }
{dp}			{ if(debugMode) System.out.println("Trovato simbolo dp"); return symb(ParserSym.dp); }
{pv}			{ if(debugMode) System.out.println("Trovato simbolo pv"); return symb(ParserSym.pv); }

{class_name}	{ if(debugMode) System.out.println("Trovato simbolo class_name: "+yytext()); return symb(ParserSym.class_name, new String(yytext())); }
{time}			{ if(debugMode) System.out.println("Trovato simbolo time: "+yytext()); return symb(ParserSym.time, new String(yytext())); }

{prop}			{ if(debugMode) System.out.println("Trovato simbolo prop: "+yytext()); return symb(ParserSym.prop, new String(yytext())); }

{rgb_col}		{ if(debugMode) System.out.println("Trovato simbolo rgb_col: "+yytext()); return symb(ParserSym.rgb_col, new String(yytext())); }

{nl}|" "|"\t"   {;}

.				{ System.err.println("Warning: testo non riconosciuto alla linea "+yyline+", colonna "+yycolumn+", testo = '"+yytext()+"'"); }
